﻿#if !SILVERLIGHT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interactivity;

namespace LogoFX.Infra.Interactivity.Behaviors
{
    /// <summary>
    /// 
    /// </summary>
    public class IpFormatBehavior:Behavior<TextBox>
    {
        protected override void OnAttached()
        {

            base.OnAttached();
            AssociatedObject.Loaded += AssociatedObjectLoaded;
            AssociatedObject.PreviewTextInput += AssociatedObjectPreviewTextInput;
            AssociatedObject.PreviewKeyDown += AssociatedObjectPreviewKeyDown;
            AssociatedObject.LostFocus += AssociatedObjectLostFocus;
            AssociatedObject.TextChanged += AssociatedObjectTextChanged;

            DataObject.AddPastingHandler(AssociatedObject, Pasting);

        }

        private void Pasting(object sender, DataObjectPastingEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void AssociatedObjectTextChanged(object sender, TextChangedEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void AssociatedObjectLostFocus(object sender, RoutedEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void AssociatedObjectPreviewKeyDown(object sender, KeyEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void AssociatedObjectPreviewTextInput(object sender, TextCompositionEventArgs e)
        {            
        }

        private void AssociatedObjectLoaded(object sender, RoutedEventArgs e)
        {
            throw new NotImplementedException();
        }

        protected override void OnDetaching()
        {
            base.OnDetaching();
            base.OnDetaching();
            AssociatedObject.Loaded -= AssociatedObjectLoaded;
            AssociatedObject.PreviewTextInput -= AssociatedObjectPreviewTextInput;
            AssociatedObject.PreviewKeyDown -= AssociatedObjectPreviewKeyDown;
            AssociatedObject.LostFocus -= AssociatedObjectLostFocus;
            AssociatedObject.TextChanged -= AssociatedObjectTextChanged;
            DataObject.RemovePastingHandler(AssociatedObject, Pasting);

        }
    }
}
#endif